package com.xdjd.mobile.business.dao.mapper.activity;

import com.xdjd.mobile.business.entity.model.activity.ActivityUserClockPo;
import com.xdjd.mobile.business.entity.vo.ClockDetailVO;
import com.xdjd.mobile.business.entity.vo.ClockRecordListVO;
import com.xdjd.mobile.business.entity.vo.LockListVO;
import com.xdjd.mobile.business.entity.vo.LockSuperviseListVO;
import net.oschina.durcframework.easymybatis.dao.CrudDao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface ActivityUserClockPoDao extends CrudDao<ActivityUserClockPo> {
    @Update("update activity_user_clock set bonus_pool=bonus_pool+#{bonus} where clock_no=#{clockNo}")
    int addBonusPool(@Param("clockNo") String clockNo, @Param("bonus") Long bonus);

    @Update("update activity_user_clock set remain_day=remain_day-1 where clock_no=#{clockNo} and remain_day>0")
    int reduceRemainDay(@Param("clockNo") String clockNo);

    List<LockSuperviseListVO> lockSuperviseList(@Param("id") Long id, @Param("curDate") String curDate);

    List<LockListVO> lockList(Long id);

    ClockDetailVO clockDetail(@Param("id") Long id, @Param("curDate") String curDate);

    List<ClockRecordListVO> clockRecordList(String clockNo, List<Integer> curDays);
}